package cn.wolfcode.wolf2w.business.util;

import javax.xml.crypto.Data;
import java.awt.*;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

public class DateUtil {
    /*
    * 根据传入的时间，返回这个时间对应天的最后一分一秒
    * */
    public static Date getEndDate(Date date){
        Calendar instance = Calendar.getInstance();
        //初始化时间
        instance.setTime(date);
        instance.set(Calendar.HOUR_OF_DAY,23);
        instance.set(Calendar.MINUTE,59);
        instance.set(Calendar.SECOND,59);
        return instance.getTime();
    }

    public static Long getDateBetween(Date date1,Date date2){
        long l = date1.getTime() - date2.getTime();
        //取绝对值
        return Math.abs(l) / 1000;
    }
}
